package de.se2.sharebox.frames;

import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;

public class EigenschaftenAnzeigen extends JFrame implements ActionListener
{

	private JLabel jlbName = new JLabel("Dateiname: ");
	private JLabel jlbDateiName = new JLabel();
	private JLabel jlbGroesse = new JLabel("Dateigroesse: ");
	private JLabel jlbDateiGroesse = new JLabel();
	private JButton jbOk = new JButton("Ok");

	public EigenschaftenAnzeigen(String name, int size)
	{
		this.setSize(200, 200);
		this.InitForm(name, size);
	}

	private void InitForm(String name, int size)
	{
		setTitle("Eigenschaften");
		this.setLayout(new GridLayout(0, 2, 6, 4));
		this.add(jlbName);
		jlbDateiName.setText(name);
		this.add(jlbDateiName);
		this.add(jlbGroesse);
		jlbDateiGroesse.setText("" + size);
		this.add(jlbDateiGroesse);
		this.add(jbOk);
		jbOk.addActionListener(this);
	}

	@Override
	public void actionPerformed(ActionEvent e)
	{
		this.setVisible(false);
	}

}
